package edu.uw.cs.cse461.sp12.util;

import edu.washington.cs.cse461.project4.DDNSAndroidActivity;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.text.format.Formatter;

public class IPFinder {
	
	public static String getIpAddress(){
		WifiManager wifiManager = (WifiManager)DDNSAndroidActivity.APP_CONTEXT.getSystemService(DDNSAndroidActivity.APP_CONTEXT.WIFI_SERVICE);
		WifiInfo wifiInfo = wifiManager.getConnectionInfo();
		int wifiIPInt = wifiInfo.getIpAddress();
		String wifiIP = Formatter.formatIpAddress(wifiIPInt);

		return wifiIP;
	}


}